package com.xing.tools;

import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

/**
 * Created by xingzhe on 2018/9/20.
 */
@Component
public class MagnetSearchUtil {

    /**
     * http://www.btdog1.com/
     * https://www.cilizhan.net/
     * http://feikebt.xyz/
     * http://juzicili.com/
     * https://www.torrentkitty.tv/
     * http://cn.btbit.cc/
     *
     */

    public static boolean isTitleRight(String title,String id){
        boolean result = true;
        if(StringUtils.isEmpty(title)){
            return false;
        }
        title = title.toLowerCase();

        if(!title.contains(id) && !title.contains(id.replace("-", ""))){
            result = false;
        }

        for(String filter:titleFilter){
            if(title.contains(filter)){
                result = false;
            }
        }
        return result;
    }

    public static boolean isDetailRight(String detail){
        detail = detail.toLowerCase();
        for(String filter:detailFilter){
            if(detail.contains(filter)){
                return false;
            }
        }
        return true;
    }

    private static final String[] titleFilter = {"sis001","第一會所","裸聊","A片"};
    private static final String[] detailFilter = {"sis001","av视频","av1024","草榴社区","草榴社區","porn","sexinsex","桃花族"};
}
